package cn.edu.controller;

import cn.edu.domain.PieData;
import cn.edu.service.lead_InfomationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Davey chan
 */
@RestController
@RequestMapping("/lead_Infomation")
public class lead_InfomationController  {
@Autowired
private lead_InfomationService infomationService;
    @RequestMapping("/getPie")
    public Result getPie(String academyName,String departmentName){
        List<PieData> pie = infomationService.getpie(academyName,departmentName);
        return new Result(Code.GET_OK,pie);
    }
    //  获取柱状图的数据
    @RequestMapping("/getBar1")
    public Result getBar1(){
        List<Integer> bar = infomationService.getBar1();
        return new Result(Code.GET_OK,bar);
    }

    @RequestMapping("/getBar")
    public  Result getBar(String academyName,String departmentName,String year) {
        List<Integer> bar = infomationService.getBar(academyName,departmentName,year);
        return new Result(Code.GET_OK,bar);
    }
    @RequestMapping("/getAward")
    public Result getAward(String academyName,String departmentName,String year){
        List<PieData> award = infomationService.getAward(academyName,departmentName,year);
        return new Result(Code.GET_OK,award);
    }
    @RequestMapping("/getExamine")
    public Result getExamine(String academyName,String departmentName){
        List<Integer> bar = infomationService.getExamine(academyName,departmentName);
        return new Result(Code.GET_OK,bar);
    }
}
